package roborally;

/**
 * @author Jef Keijers/Bachelor of Science: Informatics
 * @version 1.0
 */
public class getAtLeastEnergy extends EnergyAtLeast{
	
	public Element getElementBack(Element element, double amount) {
		if (element instanceof Robot){
			if (((Robot) element).getEnergy().getValue() >= amount)
				return element;			
		} else if (element instanceof Battery) {
			if (((Battery)element).getEnergy().getValue() >= amount)
				return element;
		} else if (element instanceof RepairKit) {
			if (((RepairKit)element).getEnergy().getValue() >=amount)
				return element;
		}
		return null; 
	}
}
